package cn.yunhe.action.temp;

import cn.yunhe.pojo.Book;
import cn.yunhe.service.BookService;
import cn.yunhe.util.BaseAction;
import com.opensymphony.xwork2.ModelDriven;

public class UpdateBookAction3 extends BaseAction implements ModelDriven {
    private Book book;


    BookService bookService=new BookService();
    public String updateBook(){
        System.out.println("<====book.getBname()======>"+book.getBname());
        boolean flag=bookService.updateBook(book);
        if (flag){
            return SUCCESS;
        }else {
            return null;
        }
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    @Override
    public Book getModel() {
        if (book==null){
            book=new Book();
        }
        return book;
    }
}
